<!DOCTYPE html>
<html>

<head>
  <title>Window</title>

  <script type="text/javascript">
    function msg0() {
      window.alert("Hello Coding Man");
    }

    function msg1() {
      var v = confirm("Are u sure?");
      if (v == true) {
        alert("ok");
      }
      else {
        alert("cancel");
      }
    }
    var myWin;
    function msg2() {
      myWin = window.open("","",'width=200,height=100');
    }

    function msg3() {
      setTimeout(msg0, 2000);
    }

    function msg4() {
      myWin.close();
    }
    function msg5() {
      myWin.moveTo(100, 200);
      myWin.focus();
    }
    function msg6() {
      myWin.resizeTo(400, 400);
      myWin.focus();
    }
    function msg7() {
      myWin.moveBy(100, 0);
      myWin.focus();
    }
  </script>
</head>

<body>  
  <input type="button" value="Alert" onclick="msg0()" />
  <input type="button" value="Confirm" onclick="msg1()" />
  <input type="button" value="Open" onclick="msg2()" />
  <input type="button" value="TimeOut" onclick="msg3()" />
  <input type="button" value="MoveTo" onclick="msg5()" />
  <input type="button" value="MoveBy" onclick="msg7()" />
  <input type="button" value="Resize" onclick="msg6()" />
  <input type="button" value="Close" onclick="msg4()" />
</body>

</html>